from django import forms
from django.contrib.auth import get_user_model
# from django.forms import fields

User=get_user_model() #获得userModel，在此即指MyUser



class CreateUserForm(forms.ModelForm):
    class Meta:
        model=User
        fields=('username','password','comfirm_password')
        widgets={
            'password':forms.PasswordInput(),
            'comfirm_password':forms.PasswordInput(),
        }

class LoginForm(forms.Form):
    #确定login表单
    username=forms.CharField(max_length=150,min_length=1)
    password=forms.CharField(max_length=150,min_length=1,widget=forms.PasswordInput())
